from django.http import HttpResponse
from django.http import JsonResponse
from django.shortcuts import render,HttpResponse,redirect

import hashlib
import json



def index(request):
    list = [{"name": "John", "age": 30}, {"name": "Mary", "age": 25}]

    return JsonResponse(list,safe=False)

def detail(request, question_id):
    return HttpResponse("You're looking at question %s." % question_id)

def results(request, question_id):
    response = "You're looking at the results of question %s."
    return HttpResponse(response % question_id)


def vote(request, question_id):
    return HttpResponse("You're voting on question %s." % question_id)

def newsAdd(request):
    list = [{"name": "John", "age": 30}, {"name": "Mary", "age": 25}]
    return JsonResponse(list,safe=False)
